.class Lorg/microemu/android/MicroEmulator$1;
.super Ljava/lang/Object;
.source "MicroEmulator.java"

# interfaces
.implements Lorg/microemu/EmulatorContext;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lorg/microemu/android/MicroEmulator;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field private deviceDisplay:Lorg/microemu/device/DeviceDisplay;

.field private fontManager:Lorg/microemu/device/FontManager;

.field private inputMethod:Lorg/microemu/device/InputMethod;

.field final synthetic this$0:Lorg/microemu/android/MicroEmulator;


# direct methods
.method constructor <init>(Lorg/microemu/android/MicroEmulator;)V
    .locals 1
    .parameter

    .prologue
    .line 83
    iput-object p1, p0, Lorg/microemu/android/MicroEmulator$1;->this$0:Lorg/microemu/android/MicroEmulator;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 85
    new-instance v0, Lorg/microemu/android/device/AndroidInputMethod;

    invoke-direct {v0}, Lorg/microemu/android/device/AndroidInputMethod;-><init>()V

    iput-object v0, p0, Lorg/microemu/android/MicroEmulator$1;->inputMethod:Lorg/microemu/device/InputMethod;

    .line 87
    new-instance v0, Lorg/microemu/android/device/AndroidDeviceDisplay;

    invoke-direct {v0, p0}, Lorg/microemu/android/device/AndroidDeviceDisplay;-><init>(Lorg/microemu/EmulatorContext;)V

    iput-object v0, p0, Lorg/microemu/android/MicroEmulator$1;->deviceDisplay:Lorg/microemu/device/DeviceDisplay;

    .line 89
    new-instance v0, Lorg/microemu/android/device/AndroidFontManager;

    invoke-direct {v0}, Lorg/microemu/android/device/AndroidFontManager;-><init>()V

    iput-object v0, p0, Lorg/microemu/android/MicroEmulator$1;->fontManager:Lorg/microemu/device/FontManager;

    return-void
.end method


# virtual methods
.method public getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;
    .locals 1

    .prologue
    .line 102
    iget-object v0, p0, Lorg/microemu/android/MicroEmulator$1;->deviceDisplay:Lorg/microemu/device/DeviceDisplay;

    return-object v0
.end method

.method public getDeviceFontManager()Lorg/microemu/device/FontManager;
    .locals 1

    .prologue
    .line 106
    iget-object v0, p0, Lorg/microemu/android/MicroEmulator$1;->fontManager:Lorg/microemu/device/FontManager;

    return-object v0
.end method

.method public getDeviceInputMethod()Lorg/microemu/device/InputMethod;
    .locals 1

    .prologue
    .line 98
    iget-object v0, p0, Lorg/microemu/android/MicroEmulator$1;->inputMethod:Lorg/microemu/device/InputMethod;

    return-object v0
.end method

.method public getDisplayComponent()Lorg/microemu/DisplayComponent;
    .locals 2

    .prologue
    .line 93
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    const-string v1, "MicroEmulator.emulatorContext::getDisplayComponent()"

    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 94
    const/4 v0, 0x0

    return-object v0
.end method

.method public getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;
    .locals 3
    .parameter "name"

    .prologue
    .line 111
    :try_start_0
    const-string v1, "/"

    invoke-virtual {p1, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 112
    iget-object v1, p0, Lorg/microemu/android/MicroEmulator$1;->this$0:Lorg/microemu/android/MicroEmulator;

    invoke-virtual {v1}, Lorg/microemu/android/MicroEmulator;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v1

    const/4 v2, 0x1

    invoke-virtual {p1, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v1

    .line 118
    :goto_0
    return-object v1

    .line 114
    :cond_0
    iget-object v1, p0, Lorg/microemu/android/MicroEmulator$1;->this$0:Lorg/microemu/android/MicroEmulator;

    invoke-virtual {v1}, Lorg/microemu/android/MicroEmulator;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v1

    invoke-virtual {v1, p1}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    goto :goto_0

    .line 116
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 117
    .local v0, e:Ljava/io/IOException;
    invoke-static {v0}, Lorg/microemu/log/Logger;->debug(Ljava/lang/Throwable;)V

    .line 118
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public platformRequest(Ljava/lang/String;)Z
    .locals 4
    .parameter "url"

    .prologue
    .line 124
    iget-object v0, p0, Lorg/microemu/android/MicroEmulator$1;->this$0:Lorg/microemu/android/MicroEmulator;

    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    invoke-virtual {v0, v1}, Lorg/microemu/android/MicroEmulator;->startActivity(Landroid/content/Intent;)V

    .line 126
    const/4 v0, 0x1

    return v0
.end method
